[Unit]
Description=Blackbox Exporter
After=network-online.target
StartLimitInterval=0
StartLimitIntervalSec=0

[Service]
Type=simple
PIDFile=/var/run/blackbox_exporter.pid
User={{ exporter_user }}
Group={{ exporter_group }}
PermissionsStartOnly=true
ExecReload=/bin/kill -HUP $MAINPID
ExecStart={{ software_install_path }}/blackbox_exporter/blackbox_exporter \
  --config.file={{ exporter_conf_path }}/config.yml \
  --web.listen-address={{ exporter_web_listen_address }}{% for flag, flag_value in exporter_config_flags_extra.items() %} \
  --{{ flag }}={{ flag_value }}{% endfor %}


SyslogIdentifier=blackbox_exporter
KillMode=process
Restart=always
RestartSec=5

LockPersonality=true
NoNewPrivileges=true
MemoryDenyWriteExecute=true
PrivateTmp=true
ProtectHome=true
RemoveIPC=true
RestrictSUIDSGID=true

AmbientCapabilities=CAP_NET_RAW

[Install]
WantedBy=multi-user.target
